package com.gticket.buyticket.service.serviceimpl;

import com.gticket.buyticket.pojo.Cinema;
import com.gticket.buyticket.pojo.Movie;
import com.gticket.buyticket.mapper.MovieInfoMapper;
import com.gticket.buyticket.service.MovieInfoService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Data
@Transactional
public class MovieInfoServiceImpl implements MovieInfoService {

    @Autowired
    private MovieInfoMapper movieInfoMapper;


    @Override
    public List<Movie> getAllMovies() {
        return movieInfoMapper.getAllMovies();
    }

    @Override
    public Movie getAllByMovieId(Movie movie){
        return movieInfoMapper.getAllByMovieId(movie);
    }

    @Override
    public List<Movie> searchAllMovies(Movie movie_name) {
        return movieInfoMapper.searchAllMovies(movie_name);
    }

    @Override
    public int searchMoviesNumber(Movie movie_name) {
        return movieInfoMapper.searchMoviesNumber(movie_name);
    }


}
